package com.zhou.framework.server.controller;

import com.zhou.framework.aop.anotation.LogOption;
import com.zhou.framework.aop.enums.LogLevel;
import com.zhou.framework.model.RS;
import com.zhou.framework.server.model.Server;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lang.zhou
 * @since 2023/2/24
 */
@Api(tags = "服务器信息接口")
@RestController
@RequestMapping("/sys/server")
public class ServerController {

    @GetMapping("/info")
    @ApiOperation("查询服务器配置信息")
    @LogOption(value = LogLevel.QUERY,response = true)
    public RS getInfo() throws Exception {
        Server server = new Server();
        server.copyTo();
        return RS.data(server);
    }

}
